<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderDetailTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//
		Schema::create('order_detail', function($table){
			$table->bigIncrements('id');
			$table->bigInteger('order')->default(0)->unsigned();
			$table->bigInteger('product')->default(0)->unsigned();
			$table->bigInteger('price')->default(0);
			$table->bigInteger('quantity')->default(0);
			$table->timestamps();
			$table->softDeletes();

			$table->foreign('order')->references('id')->on('order');
			$table->foreign('product')->references('id')->on('product');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
	}

}
